<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">
function validateForm()
{
var x=document.forms["FormRegister"]["FullName"].value;
if (x==null || x=="")
  {
  alert("Full name must be filled out");
  return false;
  }
  
  
var e=document.forms["FormRegister"]["userEmail"].value;
var atpos=e.indexOf("@");
var dotpos=e.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=e.length)
  {
  alert("Not a valid e-mail address");
  return false;
  }


var y=document.forms["FormRegister"]["userNum"].value;
if(isNaN(y)||y.indexOf(" ")!=-1)
{
   alert("Enter numeric value in phone number field")
   return false;
}
if (y.length>10 || y.length<10)
{
     alert("phone number must have 10 characters");
     return false;
}
  

var z=document.forms["FormRegister"]["userName"].value;
if (z==null || z=="")
  {
  alert("userName must be filled out");
  return false;
  }

var p1=document.forms["FormRegister"]["userPass"].value;
var p2=document.forms["FormRegister"]["password2"].value;
if (p1==null || p1=="")
  {
  alert("Password must be filled out");
  return false;
  }
if (p2==null || p2=="")
{
alert("Confirm Password field must be filled out");
return false;
}

if (p1!=p2)
{
	alert("Password and Confirm Password should match");
	return false;
}

}

</script>
</head>


<body>
	<form name="FormRegister" action="../RegistrationDetailsServlet" method="post"
		onsubmit="return validateForm()">
		<table cellpadding=2 cellspacing=1 border="1" bgcolor="cornsilk"
			align="center">
			<tr>
				<th bgcolor="cornsilk" colspan=2><font size=3> New
						Participant Registration</font> <font size=1 color="red"><sup>*</sup>
						Required Fields</font></th>
			</tr>

			<tr>
				<td valign="top">Full Name<sup>*</sup><br> <input
					type="text" name="FullName" maxlength=50
					value="${participant.fname}">
				</td>
			</tr>
			<tr bgcolor="cornsilk">
				<td valign="top">E-Mail<sup>*</sup> <br> <input
					type="text" name="userEmail" maxlength=125
					value="${participant.email}"> <br>
				</td>
			<tr>
				<td valign="top">Address<br> <textarea name="userAddress"
						rows="5" columns="20" value="${participant.address}">
</textarea>
				</td>
			</tr>

			<tr bgcolor="cornsilk">
				<td valign="top">Phone No.<sup>*</sup> <br> <input
					type="text" name="userNum" maxlength=10 value="${participant.phno}">
				</td>
			</tr>

			<tr bgcolor="cornsilk">
				<td valign="top" colspan=2>Desired User Name<sup>*</sup> <br>
					<input type="text" name="userName" maxlength=10> <input
					type="button" onclick="" value="check availability" /></td>
			</tr>
			<tr bgcolor="cornsilk">
				<td valign="top">Password<sup>*</sup> <br> <input
					type="password" name="userPass" maxlength=10>
				</td>
				<td valign="top">Confirm Password<sup>*</sup> <br> <input
					type="password" name="password2" maxlength=10>
				</td>
				<br>
			</tr>


			<tr bgcolor="cornsilk">
				<td align="center" colspan=2><input type="submit"
					value="Submit"> <input type="reset" value="Reset">
				</td>
			</tr>

		</table>
	</form>
</body>
</html>